<?php
/*
*	Kleophatra - Open Source Content Management System
*	------------------------------------------------------------------------
*	Copyright (C) 2007-2010, Sergio Milardovich <smilardovich@yahoo.com.ar>
*	This program is Free Software.
*	KleoSeo - Implementatio of SEO features for Kleophatra CMS
*
*	@package	Kleophatra
*	@subpackage	/lib
*	@license	http://www.gnu.org/copyleft/gpl.html GNU/GPL License 2.0
*	@author		Sergio Milardovich <smilardovich@yahoo.com.ar>
*	@link		http://www.kleophatra.org
*/
class kleoseo extends kleocore{
	public $before_title = ':: ';
	public $after_title = ' | ';
	function make_meta(){
		$content['title'] = $this->before_title.$this->get_core_value('web_title');
		$content['keywords'] = $this->get_core_value('keywords');
		switch(KLEO_ACTUAL_MODULE){
			case 'blog':
				if(isset($_GET['p'])){
					$id = (int)$_GET['p'];
					$query = $this->query("SELECT * FROM ".KLEO_TABLE_PREFIX."blog WHERE id = $id ORDER BY id DESC LIMIT 1");
					if($this->num_rows($query) > 0){
						$row = $this->fetch_array($query);
						$content['title'] = $content['title'].$this->after_title.$row['title'];
						if($this->get_the_tags($id) !== false){
							$content['keywords'] = $this->get_the_tags($id, false);
						}
					}
				} else {
					$content['title'] = $content['title'].$this->after_title.KLEO_ACTUAL_MODULE;
				}
			break;
		}
		return $content;
	}
}
?>
